/*
        Copyright (C), 1993 SEIKO EPSON Corp.
                ALL RIGHTS RESERVED
 
        file name : strerror.c
 
        This program maps error number: code to an error message.
                parameters : int  code
                return     : pointer to a message
 
        revision history
                1st release     1993/9/30       mizutani
                modify to work on native environment, and
                add the error messages.
                                1993/12/17      shinozuka
*/

#ifdef UNIX
#include "string.h"
#else
#include <string.h>
#endif

#include <errno.h>

char *strerror(code)
    int code ;
{
    switch (code) {
    case 0 :
        return ("no error") ;
    case EPERM :
        return ("operation not permitted");
    case ENOENT :
        return ("no such file or directory");
    case ENOMEM :
        return ("cannot allocate memory");
    case EINVAL :
        return ("invalid argument");
    case ESPIPE :
        return ("illegal seek");
    case EDOM : 
        return ("domain error") ;
    case ERANGE : 
        return ("range error") ;
    default :
        return ("unknown error") ;
    }
}
